package com.gg.tsj.service.impl;

import com.gg.common.pojo.DFile;
import com.gg.tsj.mapper.DFileXiaotanMapper;
import com.gg.tsj.service.DFileService;
import com.gg.tsj.vo.PageDFileVo;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class DFileServiceImpl implements DFileService {

    @Resource
    private DFileXiaotanMapper fileMapper;

    @Override
    public PageDFileVo queryDFile(PageDFileVo vo) throws Exception {
        PageHelper.startPage(vo.getCurrentPage(),vo.getPageSize());
        List<DFile> DFileList = this.fileMapper.queryDFile(vo);
        PageInfo<DFile> studentVoPageInfo = new PageInfo(DFileList);

        PageDFileVo pageVo=new PageDFileVo();
        pageVo.setTotal(studentVoPageInfo.getTotal());
        pageVo.setRows(studentVoPageInfo.getList());
        return pageVo;
    }
}
